package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.model.product.BaseTrademark;
import com.atguigu.gmall.product.mapper.BaseTrademarkMapper;
import com.atguigu.gmall.product.service.BaseTrademarkService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author Fxz
 * @version 1.0
 * @date 2022-02-05 17:53
 */
@Service
@RequiredArgsConstructor
public class BaseTrademarkServiceImpl extends ServiceImpl<BaseTrademarkMapper, BaseTrademark>
		implements BaseTrademarkService {

	private final BaseTrademarkMapper baseTrademarkMapper;

	/**
	 * 分页查询品牌数据
	 */
	@Override
	public IPage<BaseTrademark> getBaseTradeMarkList(Page<BaseTrademark> baseTrademarkPage) {
		return baseTrademarkMapper.selectPage(baseTrademarkPage,
				Wrappers.<BaseTrademark>query().lambda().orderByDesc(BaseTrademark::getId));
	}

}
